{include file="public/header"}
<title>搜索</title>
    <style>
        body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            background-color: #fff;
        }
        /*头部*/

        .top {
            height: 60px;
            width: 100%;
            background: rgba(22, 26, 39, 1);
        }

        .top_box {
            width: 1200px;
            height: 100%;
            margin: 0 auto;
            align-items: center;
        }

        .top_name_left {
            width: 38px;
            height: 38px;
            background: rgba(52, 99, 230, 1);
            border-radius: 10px;
            margin-right: 10px;
        }

        .top_name {
            height: 60px;
            font-size: 24px;
            font-family: PingFangSC-Medium;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
            line-height: 60px;
        }

        .top_name_r {
            width: 76px;
            height: 30px;
            border-radius: 15px;
            border: 1px solid rgba(255, 255, 255, 1);
            margin-left: 26px;
            align-items: center;
            justify-content: center;
            display: flex;
        }

        .top_name_r img {
            height: 16px;
            width: 16px;
        }

        .top_name_r span {
            height: 22px;
            line-height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            margin-left: 3px;
        }

        .lii {
            height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            line-height: 22px;
            margin-right: 24px;
        }

        .top_login {
            margin-left: 36px;
            display: flex;
            align-items: center;
        }

        .top_login img {
            width: 28px;
            height: 28px;
        }

        .top_login span {
            height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(255, 255, 255, 1);
            line-height: 22px;
            margin-left: 8px;
        }

        .top_marginR {
            margin-right: 16px;
        }
        /*头部*/
        /*footer1样式*/

        .footer {
            width: 100%;
            height: 130px;
            background: rgba(31, 31, 31, 1);
            display: flex;
            align-items: center;
        }

        .footer_in {
            width: 1210px;
            margin: 0 auto;
            height: 18px;
            font-size: 13px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(153, 153, 153, 1);
            line-height: 18px;
        }
        /*footer1样式*/

        .bar {
            width: 1200px;
            height: 57px;
            align-items: center;
            margin: 0 auto;
            font-size: 12px;
            color: #999999;
        }

        .right_arrow {
            width: 14px;
            height: 14px;
            margin-left: 6px;
            margin-right: 6px;
        }

        .box {
            width: 1200px;
            margin: 0 auto;
            margin-bottom: 138px;
        }

        .left {
            width: 150px;
            background: #FFFFFF;
            box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.04);
            border-radius: 4px;
            margin-right: 20px;
        }

        .right {
            background: #FFFFFF;
            /*box-shadow:0px 4px 10px 0px rgba(0,0,0,0.04);*/
            /*border-radius:4px;*/
            padding-top: 20px;
        }

        .avatar,
        .avatar img {
            width: 80px;
            height: 80px;
            border-radius: 50%;
        }

        .avatar {
            margin: 20px auto 10px;
        }

        .avatar img {
            object-fit: cover;
        }

        .phone {
            text-align: center;
            font-size: 14px;
            color: #333;
            margin-bottom: 20px;
        }

        .title {
            font-size: 14px;
            color: #333;
            height: 40px;
            line-height: 40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
        }

        .hover:hover {
            text-decoration: underline;
            cursor: hand;
            cursor: pointer;
        }

        .blue {
            font-size: 14px;
            color: #FFFFFF;
            height: 40px;
            line-height: 40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
            background-color: #3463E6;
        }
        /*列表的样式在这里*/

        .con_li {
            height: 184px;
            /*width: 100%;*/
            display: flex;
            align-items: center;
            padding-bottom: 40px;
        }

        .con_li>img {
            width: 245px;
            height: 100%;
        }

        .con_li>span {
            height: 32px;
            font-size: 26px;
            font-family: Helvetica-Bold;
            font-weight: bold;
            color: rgba(231, 99, 76, 1);
        }

        .con_li_word {
            height: 100%;
            margin-left: 20px;
        }

        .con_li_top {
            height: 24px;
            font-size: 22px;
            font-family: PingFangSC-Medium;
            font-weight: 500;
            color: rgba(51, 51, 51, 1);
            line-height: 24px;
            margin-bottom: 20px;
        }

        .con_li_ion {
            height: 20px;
            font-size: 14px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(102, 102, 102, 1);
            line-height: 20px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
        }

        .con_li_ion_marginb {
            margin-bottom: 16px;
        }

        .con_li_ion>img {
            width: 16px;
            height: 16px;
            margin-right: 10px;
        }

        .con_li_label {
            height: 30px;
            margin-top: 24px;
        }

        .con_li_labels {
            min-width: 60px;
            height: 30px;
            background: rgba(230, 237, 255, 1);
            border-radius: 4px;
            margin-right: 10px;
            font-size: 13px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(53, 86, 179, 1);
            line-height: 30px;
            text-align: center;
            padding: 0 10px;
        }
        /*列表的样式在这里*/

        .righttt {
            width: 1030px;
        }

        .price {
            font-size: 14px;
            color: #E7634C;
            padding-top: 33px;
            padding-bottom: 20px;
            text-align: right;
        }

        .red {
            font-size: 26px;
            font-weight: bold;
        }

        .phone {
            font-size: 14px;
            color: #999;
        }

        .tel {
            font-size: 20px;
            color: #333;
        }

        .footer2 {
            width: 100%;
            height: 168px;
            background: rgba(255, 255, 255, 1);
            box-shadow: 0px -8px 20px 0px rgba(0, 0, 0, 0.04);
            /*position: absolute;
           bottom: 0px;
           left: 0;*/
        }

        .footerint {
            width: 1200px;
            height: 100%;
            margin: 0 auto;
            position: relative;
        }

        .footer_word {
            padding-top: 20px;
            padding-left: 268px;
        }

        .footer_word span {
            width: 420px;
            height: 68px;
            font-size: 22px;
            font-family: PingFangSC-Medium;
            font-weight: 500;
            color: rgba(51, 51, 51, 1);
            line-height: 34px;
            margin-bottom: 25px;
        }

        .footer_js {
            height: 21px;
            font-size: 15px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: rgba(153, 153, 153, 1);
            line-height: 21px;
            margin-right: 25px;
        }

        .footer_ma {
            width: 120px;
            height: 120px;
            padding-top: 25px;
            padding-right: 75px;
        }

        .footer_ma img {
            width: 100%;
            height: 100%;
        }

        .footer_phone {
            width: 145px;
            height: 200px;
            position: absolute;
            bottom: 0;
            left: 94px;
            box-shadow: 0px 18px 20px 0px rgba(0, 0, 0, 0.08);
        }

        .footer_phone img {
            width: 100%;
            height: 100%;
        }

        .footer_del {
            width: 16px;
            height: 16px;
            position: absolute;
            top: 17px;
            right: 3px;
        }

        .footer_del img {
            width: 100%;
            height: 100%;
        }

        .lii2 {
            height: 22px;
            font-size: 16px;
            font-family: PingFangSC-Regular;
            font-weight: 400;
            color: #84868D;
            line-height: 22px;
            margin-right: 24px;
        }
    </style>
<style>
    .swiper_search{
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        margin: 0 auto;
        width:743px;
        height:50px;
        background:rgba(255,255,255,1);
        border-radius:4px;
        display: flex;
        align-items: center;
        z-index: 2;
    }
    .swiper_click{
        height: 100%;
        padding-left: 26px;
        display: flex;
        align-items: center;
    }
    .swiper_click:hover{
        cursor: pointer;
    }
    .swiper_click span{
        height:22px;
        font-size:16px;
        font-family:PingFangSC-Regular;
        font-weight:400;
        color:rgba(51,51,51,1);
        line-height:22px;
    }
    .swiper_click img{
        height:16px;
        width: 16px;
        margin-right: 16px;
    }

    .input_class{
        height: 30px;
        padding-left: 20px;
        border-left: 1px  solid #E6E4E4;
        line-height: 30px;
        font-size:16px;
        font-weight:400;
        outline:none;
    }
    input::-webkit-input-placeholder{
        font-size:16px;
        font-family:PingFangSC-Regular;
        font-weight:400;
        color:rgba(153,153,153,1);
    }
    .swiper_s{
        width:77px;
        height:50px;
        background:rgba(52,99,230,1);
        border-radius:0px 4px 4px 0px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .swiper_s img{
        height: 18px;
        width: 18px;

    }
    .drop{
        width: 90px;
        height: 81px;
        background-color: #fff;
        box-shadow:0px 2px 8px 0px rgba(0,0,0,0.15);
        border-radius:4px;
        position: absolute;;
        top: 50px;
        left: 0;
        font-size:14px;
        font-family:PingFangSC-Regular;
        font-weight:400;
        color:rgba(51,51,51,1);
    }

    .drop_1{
        width:100%;
        height:40px;
        background:rgba(255,255,255,1);
        border-radius:3px 3px 0px 0px;
        line-height:41px;
        text-align: center;
    }
    .drop_1:hover{
        background:rgba(239,239,236,1);
        cursor: pointer;
    }
    .hidden{
        display: none;
    }
</style>
<body>
<div></div>
<div class="swiper_search" style="background-color: #F5F5F6">
    <div class="swiper_click" onclick="changeSearch()">
        <span id="tabSearch">{if $search.0 == 1}出租{/if}{if $search.0 == 2}出售{/if}{if $search.0 == 3}小区{/if}</span>
        <img src="__IMG__/pgdn.png" alt="" id="tabImage">
        <!-- <img src="__IMG__/pgup.png" alt=""> -->
    </div>
    <input type="text" name="" value="{$search.1?:''}" class="flex-con input_class" placeholder="请输入您要搜索的内容">
    <div class="swiper_s searchGo">
        <img src="__IMG__/search.png" alt="">
    </div>

    <div class="drop hidden" id="drop">
        <div class="drop_1" onclick="searchSelect(1)">
            出租
        </div>
        <div class="drop_1" onclick="searchSelect(2)">
            出售
        </div>
        <div class="drop_1" onclick="searchSelect(3)">
            小区
        </div>
    </div>
</div>
<br />
<br />
<br />
    <div class="box flex-wrap">
        <div class="righttt flex-con">
            <div class="right">
                {if $search.0 != 3}
                {volist name='data' id='d'}
                <div class="con_li" onclick="godetail({$d.h_id});">
                    <img src="{$d.h_img}" alt="">
                    <div class="con_li_word flex-con">
                        <div class="con_li_top">
                            {$d.h_title}
                        </div>
                        <div class="flex-wrap">
                            <div class="flex-con">
                                <div class="con_li_ion">
                                    <img src="__IMG__/ion2.png" alt="">
                                    <span>{$d.district}/{$d.h_xiaoqu}</span>
                                </div>
                                <div class="con_li_ion con_li_ion_marginb">
                                    <img src="__IMG__/home.png" alt="">
                                    <span>{$d.h_shis}室{$d.h_tings}厅</span>
                                </div>
                                <div class="con_li_ion">
                                    <img src="__IMG__/area.png" alt="">
                                    <span>{$d.h_mianji}m² </span>
                                </div>
                                <div class="con_li_label flex-wrap">
                                    <?php $d['h_sign'] = explode(',',trim($d['h_sign'],',')); ?>
                                    {volist name="$d['h_sign']" id='h'}
                                    <div class="con_li_labels">
                                        {$types[$h]}
                                    </div>
                                    {/volist}
                                </div>
                            </div>
                            <div>
                                <div class="price">
                                    {if $d.h_type == 1}
                                    <span class="red">{$d.h_price}</span>/月
                                    {else /}
                                    <span class="red">{$d.h_price}</span>万
                                    {/if}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
               {/volist}
                {else /}
                {volist name='data' id='d'}
                <div class="con_li" onclick="goxiaoqudetail({$d.dis_id});">
                    <img src="<?php echo explode(',',$d['dis_images'])[0]; ?>" alt="">
                    <div class="con_li_word flex-con">
                        <div class="con_li_top">
                            {$d.dis_name}
                        </div>
                        <div class="flex-wrap">
                            <div class="flex-con">
                                <div class="con_li_ion">
                                    <img src="__IMG__/ion2.png" alt="">
                                    <span>{$d.dis_address ?: '暂无'}</span>
                                </div>
                                <div class="con_li_ion con_li_ion_marginb">
                                    <img src="__IMG__/home.png" alt="">
                                    <span>户数：{$d.dis_house ?: 0}</span>
                                </div><div class="con_li_ion con_li_ion_marginb">
                                    <img src="__IMG__/home.png" alt="">
                                    <span>年代：{$d.dis_year ?: '无'}</span>
                                </div>
                                <div style="height: 10px;width: 100px;"></div>
                                <div class="con_li_ion">
                                    <img src="__IMG__/area.png" alt="">
                                    <span>总面积：{$d.dis_mianji ?: 0}㎡ </span>
                                </div>
                            </div>
                            <div>
                                <div class="price">
                                    均价<span class="red">{$d.dis_price ?: 0}</span>元
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {/volist}
                {/if}
                <ul class="pagination flex-con" style="display: flex;justify-content: flex-end;">
                    {$data->render()}
                </ul>
            </div>
        </div>
    </div>

</body>
{include file="public/footer"}
<script type="text/javascript">
    var drop = document.getElementById('drop');
    var tabImage = document.getElementById('tabImage');
    var tabSearch = document.getElementById('tabSearch');
    function changeSearch() {
        event.stopPropagation();
        if (drop.className.indexOf('hidden') > -1) {
            drop.classList.remove("hidden");
            tabImage.src = '__IMG__/pgup.png';
        }else {
            drop.classList.add("hidden");
            tabImage.src = '__IMG__/pgdn.png';
        }
    }
    function searchSelect(num){
        event.stopPropagation();
        if (num == 1) {
            tabSearch.innerHTML = "出租";
            drop.classList.add("hidden");
            tabImage.src = '__IMG__/pgdn.png';
        }else if (num ==2) {
            tabSearch.innerHTML = "出售";
            drop.classList.add("hidden");
            tabImage.src = '__IMG__/pgdn.png';
        }else if (num ==3) {
            tabSearch.innerHTML = "小区";
            drop.classList.add("hidden");
            tabImage.src = '__IMG__/pgdn.png';
        }
    }
    document.onclick = function(event){
        event = event || window.event;
        event.stopPropagation();
        drop.classList.add("hidden");
        tabImage.src = '__IMG__/pgdn.png';
    };
    $('.searchGo').click(function () {
        var text = $('#tabSearch').text();
        var type = 1;
        if(text == '出售'){
            type = 2;
        }
        if(text == '小区'){
            type = 3;
        }
        var key = $('.input_class').val().trim();
        if(key == ''){
            $('.input_class').val('');
            alert('搜索关键字不能为空');
        }else{
            location.href='/home/Index/searchResult?type='+type+'&keyword='+key;
        }
    });
</script>
<script>
    //-------------------跳转到详情----------------------
    function godetail(hid) {
        window.location.href = '/home/Index/houseInfo?h_id='+hid;
    }
    function goxiaoqudetail(dis_id) {
        window.location.href = '/home/Index/disInfo?dis_id='+dis_id;
    }
    //-----------------------end------------------
</script>